﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace PankowGame13
{
    class TrapTile:Tile
    {
        public bool hasSprung { get; set; }
        public TrapTile(string pathPicture, Vector2 pathLocation, int textureSize, ContentManager content)
        {
            hasSprung = false;
            isActive = false;
            tileTexture = content.Load<Texture2D>(pathPicture);
            tileLocation = pathLocation;
            tileSize = textureSize;
            canPass = true;
            tileRect = new Rectangle((int)tileLocation.X, (int)tileLocation.Y, textureSize, textureSize);
        }

        public void Update(ContentManager content)
        {
            if (isActive)
            {
                tileTexture = content.Load<Texture2D>(@"Trap"); 
            }
        }

        public int TrapDamage(int level)
        {
            int less = 0;
            Random rand = new Random();
            if (level > 10)
            {
                level *= 2;
            }
            else if (level > 30)
            {
                less = level - 25;
            }
            else if (level > 40)
            {
                less = level - 35;
            }
            else if (level > 50)
            {
                less = level - 45;
            }
            return rand.Next(0, 6) + level - less;
        }
    }
}
